From ccc42701ce43feccd3c704a0f7fa4885f91b5eb5 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 5 Aug 2026 14:36:00 +0000 Subject: [PATCH] Add example query to ARRIVALS_A doc --- doc/src/tables/arrivals_a.m4 | 40 ++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/doc/src/tables/arrivals_a.m4 b/doc/src/tables/arrivals_a.m4 index 559c440..7373f49 100644 --- a/doc/src/tables/arrivals_a.m4 +++ b/doc/src/tables/arrivals_a.m4 @@ -30,10 +30,6 @@ ARRIVALS_A |ARRIVALS_A_summary| -.. sidebar:: - - |OBS helpful| - The system generates a warning when the sexual swelling information associated with an individual violates what is expected: @@ -76,6 +72,42 @@ sdb_min_swelling_age_units old and less than or equal to The |ARRIVALS_A.Recorder| value may not be the same as the |ARRIVALS_A.Observer2| value. +The |OBS| view is useful when querying ARRIVALS_A. + +.. code-block:: sql + :caption: + Using OBS and ROLES to provide a more complete picture of arrivals + at the feeding station + + SELECT obs.wid, obs.type + , obs.eid + , roles.pid + , obs.date + , obs.animid + , roles.participant AS arrival + , obs.commid + , arrivals_a.seq + , obs.start AS arrived + , obs.stop AS departed + , arrivals_a.swelling + , arrivals_a.bananas + , arrivals_a.arrivaldegree + , arrivals_a.departuredegree + , arrivals_a.recorder + , arrivals_a.observer2 + , arrivals_a.cycleold + , obs.notes + , obs.event_notes + FROM obs + JOIN arrivals_a + ON (arrivals_a.eid = obs.eid) + JOIN roles + ON (roles.eid = obs.eid) + WHERE obs.behavior = 'sdb_arrivals_a' + ORDER BY roles.participant, obs.date, obs.start, obs.stop + , obs.eid; + + .. contents:: :depth: 2 -- 2.34.1